Page({
  data: {
    notifyDetail: {},
  },
  onLoad({ id }) {
    this.getNotifyDetail(id)
  },
  /**
   * 获取公告详情
   * @param {*} id
   */
  async getNotifyDetail(id) {
    if (!id) return
    const { code, data: notifyDetail } = await wx.http({ url: `/announcement/${id}` })
    if (code !== 10000) return wx.utils.toast()
    this.setData({
      notifyDetail,
    })
  },
})
